C (248/301)

From:Nicholas Clarke
Date:11 Aug 99 at 21:29:33
Subject:RE: RMBTRAP

From: Nicholas Clarke <nclarke@diku.dk>

On 11 Aug 1999, Lloyd Rosen wrote:

> > It's the only way to do it, I'm afraid. Heed the documentation, though:
> >you must make the bit change an atomic operation so no Task switch can
> >occur while you are still making the change.
>
> How do I do an atomic operation (forbid/permit ?)

Forbid/permit is atomic with the exception of interrupts(disable/enable).

Locking intuition would probably also do the trick but it would be
unfortunate if a context switch before an unlock occured if only
until your task is rescheduled.

If anything an and/or with the flag is in effect atomic using 68k. Still
you never know how a compiler will translate it if done from c/c++.

/ngc